<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>composition API-dom Ref</title>
  <script src="https://unpkg.com/vue@next"></script>
</head>
<body>
  <div id="root"></div>
</body>
<script>
  // composition API的语法下，获取真实的DOM的元素节点
  const app = Vue.createApp({
    template: `
      <div ref="hello">hello world</div>
    `,
		setup(props,context) {
			const {ref,onMounted} = Vue
			//1.定义一个 dom节点 ref名字一样的 空的响应式引用
			const hello = ref(null)
			// 2. 节点处理
			onMounted(() => {
				console.log('hello',hello.value)
			})
			// 3.导出
			return {
				hello
			}
		}
  });
  const vm = app.mount('#root');
</script>
</html>